package com.kx.smartdevice.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class Humiture implements CheckEmptyInterface{

  private Long id;
  private String deviceId;
  private Double humidity;
  private Double temperature;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date uploaddate;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getDeviceId() {
    return deviceId;
  }

  public void setDeviceId(String deviceId) {
    this.deviceId = deviceId;
  }

  public Double getHumidity() {
    return humidity;
  }

  public void setHumidity(Double humidity) {
    this.humidity = humidity;
  }

  public Double getTemperature() {
    return temperature;
  }

  public void setTemperature(Double temperature) {
    this.temperature = temperature;
  }

  public Date getUploaddate() {
    return uploaddate;
  }

  public void setUploaddate(Date uploaddate) {
    this.uploaddate = uploaddate;
  }

  @Override
  public boolean isEmpty() {
    return temperature == null || humidity == null || temperature == 0 || humidity == 0;
  }

  @Override
  public String toString() {
    return "Humiture{" +
            "id=" + id +
            ", deviceId=" + deviceId +
            ", humidity=" + humidity +
            ", temperature=" + temperature +
            ", uploaddate=" + uploaddate +
            '}';
  }
}
